home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96b.txt / 000009_icon-group-sender _Thu Oct 3 11:10:04 1996.msg < prev    next >
Internet Message Format  |  1997-01-02  |  3KB

  1. Received: by cheltenham.cs.arizona.edu; Fri, 4 Oct 1996 11:05:25 MST
  2. Date: 03 Oct 96  19:09:07 BST
  3. From: R J Hare <rjhare@tattoo.ed.ac.uk>
  4. Subject: Text & graphics
  5. To: icon-group@cs.arizona.edu
  6. Reply-To: rjhare@ed.ac.uk
  7. Organisation:  Edinburgh University Computing Services
  8. Message-Id:  <9610031909.aa16584@uk.ac.ed.tattoo>
  9. Errors-To: icon-group-errors@cs.arizona.edu
  10.  
  11. I hope this will be the last daft question I have to ask about graphics for a
  12. while!
  13.  
  14. I have a situation where I wish to type some text in a window on a line by line
  15. basis, and have that text copied to a second window also on a line by line
  16. basis, and to exactly the same point in the hidden window as on the visible
  17. window (the two are exactly the same size). Here is the code I am using to do
  18. this:
  19.  
  20. procedure typetext()
  21.  
  22. # get the x,y position of text start with left button.
  23. repeat {case Event(page) of
  24.         {&lpress : {x:=&x
  25.                     y:=&y
  26.                     break}}}
  27.  
  28. GotoXY(page,x,y)
  29. GotoXY(hpage,x,y)
  30.  
  31. repeat{char:=WReads(page,1)
  32.        if char == "\^c"
  33.        then break
  34.        if char == "\r"
  35.        then {y+:=size+2
  36.              GotoXY(page,x,y)
  37.              GotoXY(hpage,x,y)}
  38.        WWrites(hpage,char)}
  39.  
  40. return
  41. end
  42.  
  43. What happens is that all is well in the visible window, but in the hidden
  44. window, when I save it and then look at it (or when I turn off the
  45. canvas="hidden" attribute), only the first line is in the correct position.
  46. All other lines are left justifed to the edge of the window, not the selected
  47. x position - like this:
  48.  
  49.             Visible window                          Hidden window
  50.  
  51.  ____________________________________   ____________________________________ 
  52. |                                    |  |                                   |
  53. |                                    |  |                                   |
  54. |                                    |  |                                   |
  55. |                                    |  |                                   |
  56. |                                    |  |                                   |
  57. |     Some text typed in the visible |  |    Some text typed in the visible |
  58. |     window is justified perfectly  |  |window is justified perfectly      |
  59. |     OK. The text is *not* laid     |  |OK. The text is *not* laid         |
  60. |     out properly in the hidden     |  |out properly in the hidden         |
  61. |     window. Why, Please?           |  |window. Why, Please?               |
  62. |                                    |  |                                   |
  63. |                                    |  |                                   |
  64. |                                    |  |                                   |
  65. |                                    |  |                                   |
  66. |                                    |  |                                   |
  67. |                                    |  |                                   |
  68. |____________________________________|  |___________________________________|
  69.  
  70. Any ideas why this should be the case please?
  71.  
  72. Thanks.
  73.  
  74. Roger Hare
  75.